{{include file="../Common/header"}}
	<!--/header-->
	<div id="row">
		<!--left-->
		{{include file="../Common/presonal_left"}}
		<!--/left-->
		<!--right-->
		<div id="presonal-right">
			<form action="{{U('Presonal/presonal')}}" method="post">
			<div class="my-head">我的头像</div>
			<div lab="uploadFile">
				<!-- file表单 -->
			    <input id="f" type="file" multiple="true">
			    <span>类型: *.jpg,*.png 大小: 2000KB 数量: 1</span>
			    <script type="text/javascript">
			        $(function() {
			            $('#f').uploadify({
			                'formData'     : {//POST数据
			                    '<?php echo session_name();?>' : '<?php echo session_id();?>',
			                },
			                'fileTypeExts' : '*.jpg;*.png',
			                'swf'      : '{{__PUBLIC__}}/uploadify/uploadify.swf',
			                'uploader' : '{{U('upload')}}',//指定服务器上传的方法
			                'buttonText':'选择文件',
			                'fileSizeLimit' : '2000KB',
			                'uploadLimit' : 1,//上传文件数
			                'width':65,
			                'height':25,
			                'successTimeout':10,//等待服务器响应时间
			                'removeTimeout' : 0.2,//成功显示时间
			                'onUploadSuccess' : function(file, data, response) {
			                    //把php返回的数据转为json
			                    data=$.parseJSON(data);
			                    //获得图片地址
			                    var imageUrl = data.url;
			                    var li="<li>";
			                    li += "<img src='"+imageUrl+"'/>";
			                    li += "<input type='hidden' name='photo' id='photo' value='"+data.path+"'/><a href='javascript:;' id='self-close'>X</a>";
			                    li += "</li>";
			                    $("#uploadList ul").prepend(li);
			                }
			            });
			
						//关闭图片
			            var i = 1;
		           		 $('#self-close').live('click',function(){
			            	var pic=$("#photo").attr('value');
			            	$.ajax({
			                	type:'post',
			                	url:"{{U('Presonal/delUpload')}}",
			                	data:{path:pic}
			              	});
			                $(this).parent('li').remove();
                			i++;
               				$('#f').uploadify('settings','uploadLimit',i);
		            	})
			        });
				    </script>
				    <div id="uploadList">
				        <ul>
				        	{{if value="$data['photo']"}}
							<li>
								<img src="{{$data['photo']}}" />
								<input type="hidden" name="photo" id="photo" value="{{$data['photo']}}" /><a href="javascript:;" id="self-close">X</a>
							</li>
							{{endif}}
				        </ul>
				    </div>
				</div>
			<div class="my-head">个人信息</div>
				<p class="span-main">昵称：</p><input type="text" class="form-name" name="nickname" value="{{$data['nickname']}}"/><br />
				<p class="span-main">邮箱：</p><input type="email" class="form-name" name="email" value="{{$data['email']}}"/><br />
				<p class="span-main span-presonal">个性签名:</p><textarea class="form-text" name="personalized">{{$data['personalized']}}</textarea><br />
				<input type="hidden" name="uid" value="{{$_SESSION['nickuser']['uid']}}" />
				<input type="submit" value="保存" class="form-btn"/>
			</form>
		</div>
		<!--/right-->
	</div>
	<!--footer-->
	{{include file="../Common/footer"}}
	<!--/footer-->
	</body>
</html>
